import http from '@/utils/http'

export function downloadApi(data, params) {
  return http.request({
    url: '/api/download/getAll',
    method: 'POST',
    data,
    params
  })
}

export function downloadDeleteApi(_id) {
  return http.request({
    url: `/api/download/${_id}`,
    method: 'DELETE',
  })
}

export function downloadDetailApi(_id) {
  return http.request({
    url: `/api/download/${_id}`,
    method: 'GET',
  })
}

export function downloadAddApi(data) {
  return http.request({
    url: `/api/download`,
    method: 'POST',
    data,
  })
}

export function downloadUpsertApi(data) {
  return http.request({
    url: `/api/download/${data?.id}`,
    method: 'PUT',
    data,
  })
}